package com.modificial.shiro.system.dao;

import com.modificial.shiro.mapper.BaseMapper;
import com.modificial.shiro.system.domain.SysUserRole;
import org.apache.ibatis.annotations.Delete;
import org.springframework.stereotype.Repository;

/**
 * @author modificial
 * @date 2018/8/4 0004
 * @company modificial_org
 * @description 用户角色关系操作
 */
@Repository
public interface UserRoleDao extends BaseMapper<SysUserRole> {
    /**
     * 根据角色id删除用户角色关系
     * @param roleId 角色关系
     * @return
     */
    @Delete("delete from sys_user_role where role_id=#{roleId}")
    int deleteUserByRole(String roleId);

    /**
     * 根据女用户id删除用户角色关系
     * @param userId 用户id
     * @return
     */
    @Delete("delete from sys_user_role where user_id=#{userId}")
    int deleteUser(String userId);
}
